package com.itbaizhan.web;

import com.itbaizhan.pojo.Items;
import com.itbaizhan.pojo.Orders;
import com.itbaizhan.pojo.Users;
import com.itbaizhan.service.impl.UsersService;
import com.itbaizhan.service.impl.impl.UsersServiceImpl;

import java.util.List;

public class Test3 {
    public static void main(String[] args) throws NullPointerException{
        UsersService us=new UsersServiceImpl();
        Users users=us.findUsers(1);
        System.out.println("Users:"+users.getUserid()+" "+users.getUsername()+" "+users.getUserage());
        List<Orders> list= users.getOrders();
        for(Orders orders:list){
            System.out.println("Orders:" +orders.getOrderid()+" "+orders.getOrderprice());
            List<Items> items =orders.getItems();
            for(Items item :items){
                System.out.println("Items"+item.getItemid()+" "+item.getItemname()+" "+item.getItemnum());

            }

        }


    }

}
